package Thread;

public class AddDemo {
    public static void main(String[] args) {
        //1.创建对象
        sum s=new sum ();
        System.out.println();
        //2.匿名内部类
        Add a=new Add() {
            public double sum(int x, int y) {
                return x+y;
            }
        };
        }



        //3.Lambda表达式
        /*Add a1=(x,y)->{return x+y;};
        System.out.println(a1.sum(300,100));*/
    }










interface  Add{
    public  abstract double sum(int x,int y);
}
class sum implements  Add{
    @Override
    public double sum(int x, int y) {
        return x+y;
    }
}

